package org.dtrd.modules.doctor.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.doctor.entity.bean.TeamInfo;

import java.util.Date;


/**
 * <p>
 * 
 * </p>
 *
 * @author QR
 * @since 2021-11-30 16:48:37
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_doctor_team")
public class DtrdEntRdDoctorTeam {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 团队名称
     */
    private String name;

    /**
     * 团队描述
     */
    private String description;

    private Integer manageDoctorId;

    private Date createTime;

    @TableLogic
    private Integer isDel;

    public DtrdEntRdDoctorTeam init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdEntRdDoctorTeam parseFromDTO(TeamInfo dto) {
        dataId = dto.getDataId();
        if (dataId == null) {
            init();
        }
        name = dto.getName();
        manageDoctorId = dto.getManagerId();
        description = dto.getDescription();
        return this;
    }


}
